<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo1"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<body>

<div class="layui-card">

    <div class="layui-card-header">
        <span class="layui-icon font-s10 color-desc margin-right-5"></span>陪诊陪检项目管理
        <div class="pull-right">
<!--            <button data-table-id="NoticeTable" class="layui-btn layui-btn-primary  layui-btn-sm" data-modal="/system/user/form" data-height="720px" data-width="800px">-->
<!--                <i class=" layui-icon layui-icon-addition"></i>新建护工</button>-->
        </div>
    </div>

    <div class="layui-card-line"></div>

    <div class="layui-card-body">

        <div class="layui-card-table layui-tab">
            <div class="layui-tab-content">
                <form th:replace="/pcs/project_inspection/index_search">

                </form>
                <table id="ProjectInspectionTable"  data-url='/pcs/project/inspection/index' data-target-search="form.form-search"></table>
                <script th:inline="javascript">
                    var verifyStatus = [[${verifyStatus}]]
                </script>
                <script type="text/javascript" th:inline="none">
                    $(function () {
                        $('#ProjectInspectionTable').layTable({
                            even: true, height: 'full',where:{verifyStatus:verifyStatus,orderBy:"verifyStatus:asc,id:desc"},
                            cols: [[
                                {title: '序号', type: 'numbers', width: 80},
                                {field: 'companyName', title: '陪护公司', minWidth: 200, align: 'center'},
                                {field: 'type', title: '项目类型', minWidth: 180, align: 'center', templet: function (d) {
                                        if (d.type == 2) {
                                            return '陪诊';
                                        } else if (d.type == 3) {
                                            return '陪检';
                                        } else {
                                            return '陪护';
                                        }
                                    }},
                                {field: 'title', title: '名称', minWidth: 300, align: 'center'},
                                {field: 'price', title: '陪护费用', minWidth: 90, align: 'center'},
                                {field: 'verifyStatus', title: '状态', minWidth: 90, align: 'center',templet: function (d) {
                                        if (d.verifyStatus == 1) {
                                            return '<span class="layui-font-green">已通过</span>';
                                        } else if (d.verifyStatus == 2) {
                                            return '<span class="layui-font-orange">已驳回</span>';
                                        } else {
                                            return '待审核';
                                        }
                                    }},
                                {field: 'createTime', title: '创建时间', minWidth: 100, align: 'center'},

                                {toolbar: '#toolbar', title: '操作', align: 'center', minWidth: 280, fixed: 'right'}
                            ]]
                        });
                    });



                </script>



                <script type="text/html" id="toolbar">
                    <a class="layui-btn layui-btn-sm" data-event-dbclick data-title="详情"    data-modal='/pcs/project/inspection/detail?id={{d.id}}'>详情</a>
                    <a class="layui-btn layui-btn-sm" data-event-dbclick data-title="编辑" shiro:hasPermission="pcs:projectInspection:add"   data-modal='/pcs/project/inspection/form?id={{d.id}}'>编 辑</a>
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-event-dbclick shiro:hasPermission="pcs:projectInspection:state" data-confirm="确定要删除吗?" data-action='/pcs/project/inspection/state?id={{d.id}}&status=3'>删除</a>
                    {{# if(d.verifyStatus == 0){}}
                    <a class="layui-btn layui-btn-sm layui-bg-green" data-event-dbclick  shiro:hasPermission="pcs:project:verify" data-action='/pcs/project/verify?ids={{d.id}}&verifyStatus=1'>通过</a>
                    <a class="layui-btn layui-btn-sm layui-bg-orange" data-event-dbclick  shiro:hasPermission="pcs:project:verify" data-modal='/pcs/project/canal?id={{d.id}}&verifyStatus=2'>驳回</a>
                    {{# }else if(d.verifyStatus == 1){}}
<!--                    <a class="layui-btn layui-btn-sm layui-bg-green"   shiro:hasPermission="pcs:project:verify" >已通过</a>-->
                    {{# }else if(d.verifyStatus == 2){}}
<!--                    <a class="layui-btn layui-btn-sm layui-bg-orange" data-event-dbclick   shiro:hasPermission="pcs:project:verify" >已驳回</a>-->
                    {{# } }}
                </script>

            </div>
        </div>
    </div>

</div>
</body>
</html>